<?php

namespace App\Http\Requests\Admin\V1;

use Illuminate\Foundation\Http\FormRequest;

class MenuDestroyRequest extends FormRequest
{
    /**
     * @expalin 验证规则
     * @return \string[][]
     * @method
     * @author 陈文小超
     * @maxim from专注to执行
     * @time 2021/4/1/11:37
     */
    public function rules()
    {
        return [
            'id' => ['bail', 'required', 'integer', 'min:1', 'exists:menus,id'],
        ];
    }

    /**
     * @expalin 自定义错误信息
     * @return array
     * @method
     * @author 陈文小超
     * @maxim from专注to执行
     * @time 2021/4/1/11:37
     */
    public function messages()
    {
        return [
            'id.required' => trans('admin/v1/request.menu.id-required'),
            'id.integer'  => trans('admin/v1/request.menu.id-integer'),
            'id.min'      => trans('admin/v1/request.menu.id-min'),
            'id.exists'   => trans('admin/v1/request.menu.id-exists'),
        ];
    }
}
